{if $admin and $fullPage}
<div>
    <form id="textbookSearchForm" method="POST" action="?{$znf.moduleIndex}=textbook&amp;{$znf.actionIndex}=textbookList">
        <fieldset>
            <legend>Iskanje</legend>
            <table>
                <tbody>
                    <tr>
                        <td><label for="name" >Uporabnik:</label></td>
			<td><input id="name" name="name" type="text" size="40" /></td>
                        <td><button id="searchSubmit" type="submit" class="button">Predloži</button></td>
                    </tr>
                </tbody>
            </table>
        </fieldset>
    </form>
</div>
<br />
<br />
{/if}
<div id="textbookListForm">
    <p>Za spremembo podatkov učbenika klikajte na njegov naslov.</p>
    {if count($textbooks) > 0}
    	<form id="textbookListForm" method="POST" action="?{$znf.moduleIndex}=textbook&amp;{$znf.actionIndex}=deleteTextbooks&amp;fp=t">
    	<table>
	    <thead>
			<tr>
				<th>Briši</th>
	            <th>ISBN</th>
	            <th>Naslov</th>
	            <th>Avtorji</th>
	            <th>Založnik</th>
	            <th>Leto izdaje</th>
	            <th>Cena</th>
	            <th>Zamenjava</th>
	            {if $admin}<th>Datum vnosa</th>{/if}
			</tr>
            </thead>
            <tbody>
                {foreach from=$textbooks item=textbook name=counter}
                    <tr class="{if $smarty.foreach.counter.index % 2 == 0}evenRow{else}oddRow{/if}">
                        <td class="other"><input name="delete[]" value="{$textbook.id}" type="checkbox" /></td>
                        <td class="other">{$textbook.isbn}</td>
                        <td><a href="?{$znf.moduleIndex}=textbook&amp;{$znf.actionIndex}=textbookFormDisplay&amp;id={$textbook.id}&amp;pageID={$pageID}{if $userId}&amp;userId={$userId}{/if}" title="Spremeni podatke učbenika" class="getLink">{$textbook.title}</a></td>
                        <td>{$textbook.authors}</td>
                        <td>{$textbook.publisher}</td>
                        <td class="number">{$textbook.published}</td>
                        <td class="number">{$textbook.price}</td>
                        <td class="other">{if $textbook.forchange}Da{else}Ne{/if}</td>
                        {if $admin}<td>{$textbook.offerdate|date_format:"%d.%m.%Y %H:%M"}</td>{/if}
                    </tr>
                {/foreach}
            </tbody>
        </table>
	<div class="buttons">
	    <button id="textbookSubmit" type="submit" class="button negative">Briši</button>
	    <button type="reset" class="button">Prekliči</button>
	    <button id="selectAll" type="button" class="button">Izberi vse</button>
	</div>
    	</form>
    	<div id="pager">
    	    {$pager}
    	</div>
    {else}
        <p>Trenutno je seznam vaših učbenikov prazen.</p>
    {/if}
</div>
